﻿<%@ Page Language="C#" MasterPageFile="~/Themes/ContentPage.master" %>
<script runat="server">
    protected override void OnLoad(EventArgs e)
    {
        if (NewsId <= 0)
        {
            NewsInfo info = News.GetFirstNews(this.CateogryId);
            if (info != null)
                Page.Response.Redirect(SiteUrls.Urls.FAQ(info), true);
        }
    }

    public int NewsId
    {
        get { return SiteContext.Current.Id; }
    }

    private int CateogryId
    {
        get 
        {
            if (SiteContext.Current.CategoryId > 0)
                return SiteContext.Current.CategoryId;
            
            int baseNodeId=SiteContext.Current.BaseNodeId;
            CategoryInfo firstNode = TreeTables.NewsCategories.GetFirstChildNode(baseNodeId);
            
            if (firstNode != null)
                return firstNode.Id;
            else
                return baseNodeId;
        }
    }
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="Server">

    <lswweb:NewsShow ID="aboutUs" IsRenderTag="false" runat="server">   
        <Skin>
            <asp:Label ID="lbBody" runat="server" />
        </Skin>
    </lswweb:NewsShow> 

</asp:Content>

